﻿using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Logging;
using NLog;
using NLog.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace chihuopig.Web.Framework
{
    public class MyException : IExceptionFilter
    {
        private readonly ILogger<MyException> _logger;
        //ILog log = LogManager.GetLogger(Startup.repository.Name, typeof(Exception));
        Logger Logger = NLog.LogManager.GetCurrentClassLogger();

        public void OnException(ExceptionContext context)
        {
            Logger.Error(context.Exception);
        }
    }
}
